package com.seo.service.user.impl;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageInfo;
import com.seo.function.PageTool;
import com.seo.mapper.user.ConfigMapper;
import com.seo.mapper.user.UserDomainMapper;
import com.seo.mapper.user.UserMapper;
import com.seo.mapper.user.role.UserRoleMapper;
import com.seo.pojo.ReturnBody;
import com.seo.service.sms.sdk.SmsCodeService;
import com.seo.service.user.sdk.UserChildService;
import com.seo.service.user.sdk.UserService;
import com.seo.utils.ClientConst;
import com.seo.utils.DataUtil;
import com.seo.utils.DateUtil;
import com.seo.utils.Jurisdiction;
import com.seo.utils.PatternTool;

import cn.hutool.core.lang.PatternPool;
import cn.hutool.core.util.ReUtil;
import cn.hutool.crypto.SecureUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service("userChildService")
public class UserChildServiceImpl implements UserChildService {

	@Autowired
	private UserMapper userMapper;

	@Autowired
	private PageTool pageTool;


	

	@Override
	public ReturnBody getChildUserList(Map<String, Object> params) {
		ReturnBody body = ReturnBody.init();
		log.info("下级用户列表[{}]", params);
		String yTime = DateUtil.getAfterDayDate(DateUtil.getTimesmorning(), -1, 1);
		params.put("yTime", yTime);

		Integer userId = Jurisdiction.getT("id", Integer.class, ClientConst.SESSION_USER);

		params.put("parentId", userId);

		PageInfo<?> page = pageTool.getZdyPage(userMapper::getUserCnt, userMapper::getUserList, params);

		body.put("page", page);

		return body.success();
	}


}
